RootResultFolderName = 'D:\School\Meeting\Program\Matlab\Result\SVMResults';
cd(RootResultFolderName);

Dataset = 'Ddavid_yeast';
FoldNumber = 1;
Filename = [Dataset '_' int2str(20) '_' int2str(25)];
FilenameWithFold = [Filename '_Fold' int2str(FoldNumber)];
load(FilenameWithFold);

LabelTraining = TrueLabelTraining;
% LabelTraining = SampledTrueLabelTraining;

N = size(SampledTrueLabelTraining, 1);
M = size(SampledTrueLabelTraining, 2);
N2 = size(AllDataTesting, 1);

CondInfo.C = 1.0;
CondInfo.G = 1.0 / N;
WeightP = ones(N, 1);

ClassResult.pre_label = zeros(N2, M);
ClassResult.output = zeros(N2, M);

for i = 1:M
    % Training
    Ddavid_call_SVM_training_single_label(AllDataTraining, LabelTraining(:, i), CondInfo.C, CondInfo.G, WeightP);
    
    % Testing
    [ClassResult.output(:, i)] = Ddavid_call_SVM_testing_single_label(AllDataTesting, TrueLabelTesting(:, i));
end

ClassResult.pre_label = (ClassResult.output >= 0.5) * 2 - 1;
ClassResult.HammingLoss = Hamming_loss(ClassResult.pre_label', TrueLabelTesting');
